
import 'package:favorcate/ui/pages/filter/filter.dart';
import 'package:favorcate/ui/shared/size_fit.dart';
import 'package:flutter/material.dart';

class JKDrawerContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        buildHeadView(context),
        buildListTitle(context, Icon(Icons.restaurant), '进餐', () {
          Navigator.of(context).pop();
        }),
        buildListTitle(context, Icon(Icons.settings), '过滤', () {
          Navigator.of(context).pushNamed(JKFilterScreen.routeName);
        })
      ],
    );
  }

  Widget buildHeadView(BuildContext context) {
    return Container(
      color: Colors.orange,
      alignment: Alignment(0, 0.5),
      width: double.infinity,
      height: 120.px,
      margin: EdgeInsets.only(bottom: 20),
      child: Text('开始动手', style: Theme.of(context).textTheme.headline3,),
    );
  }

  Widget buildListTitle(BuildContext context, Widget icon, String title, Function action) {
    return ListTile(
      leading: icon,
      title: Text(title, style: Theme.of(context).textTheme.headline3,),
      onTap: action,
    );
  }
}
